<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <%--    BootStrap美化界面--%>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<p>
    <a href="${pageContext.request.contextPath}/login/goOut">退出</a>
</p>

<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>${username}的个人订单一览：</small>
                </h1>
            </div>
        </div>

        <div class="row">
            <div class="col-md-4 column">
<%--                ==============================================--%>
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/login/toCompleteDate">查看历史订单</a>
<%--                <a class="btn btn-primary" href="${pageContext.request.contextPath}/login/allDate">显示全部订单状况</a>--%>
    <%--                ==============================================--%>
            </div>
            <div class="col-md-4 column"></div>
            <div class="col-md-4 column">
                <%--                查询个人订单--%>
                <form class="form-inline" action="${pageContext.request.contextPath}/login/queryUserDate" method="post" style="float: right">
                    <span style="color: red;font-weight: bold">${error}</span>
                    <input type="text" name="queryUsage_id" class="form-control" placeholder="请输入要查询的订单号">
                    <input type="submit" value="查询" class="btn btn-primary">
                </form>
            </div>

        </div>

    </div>

    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>订单id</th>
                    <th>订单编号</th>
                    <th>最近一次采集数据时间</th>
                    <th>订单温度情况</th>
                    <th>订单位置详情</th>
                </tr>
                </thead>
                <%--                订单从数据库中查询出来，从这个list中遍历出来：foreach--%>
                <tbody>
                <c:forEach var="data" items="${list}">
                    <tr>
                        <td>${data.id}</td>
                        <td>${data.usage_id}</td>
                        <td>${data.time}</td>
                        <td>${data.temperature}</td>
                        <td><a href="${pageContext.request.contextPath}/login/locationByUsageId?usage_id=${data.usage_id}">点击查看订单位置详情</a></td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
</div>
</body>
</html>
